package com.interview.product.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.interview.core.page.Page;
import com.interview.product.entity.Product;
import com.interview.product.query.ProductConditionQuery;
import com.interview.product.repository.ProductRepository;

@Service
public class ProductService {
	@Resource
	private ProductRepository productRepository;

	public List<Product> findAll() {
		return productRepository.findAll();
	}

	public Product save(Product product) {
		return productRepository.save(product);
	}

	public void delet(String id) {
		productRepository.delet(id);
	}

	public Page findByConditionQuery(ProductConditionQuery producConditionQuery) {
		
		return productRepository.findByConditionQuery(producConditionQuery);
	}

	public Product findOne(String id) {
		return productRepository.findOne(id);
	}

	public void update(Product product) {
		productRepository.update(product);
	}

}
